import request from '@/utils/request'

export function loginApi(data) {
  return request({
    url: '/auth/local',
    method: 'post',
    data
  })
}
// export function loginApi(data) {
//   return request({
//     url: '/auth/local/register',
//     method: 'post',
//     data
//   })
// }

export function getAgents() {
  return request({
    url: '/pages'
  })
}

// 页面数据渲染
export function Drawing(params) {
  console.log(params)
  return request({
    url: `/clients`,
    method: 'get',
    params
  })
}

// 添加用户接口
export function addCustomerFn(data) {
  return request({
    url: '/clients',
    method: 'post',
    data
  })
}
// 删除客户
export function deleteKehu(id) {
  return request({
    url: `/clients/${id}`,
    method: 'delete'
  })
}
// 获取用户详情/
export function deitCilentFn(id) {
  return request({
    url: `/clients/${id}`

  })
}
// 编辑

export function editor(data) {
  return request({
    url: `/clients/${data.id}`,
    method: 'put',
    data

  })
}
// 获取总数
export function getCilents(params) {
  return request({
    url: `/clients/count`,
    method: 'get',
    params
  })
}
// 下拉列表请求
export function manage(params) {
  return request({
    url: '/agents',
    method: 'get',
    params
  })
}
